home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
biz
/
swood
/
FWTabTools.lha
/
FWTabTools
/
FWTableEdit.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-02-14
|
6KB
|
303 lines
/* $VER: 0.12, (04.01.1998), © by Thorsten Willert
Macro um Tabellen zu editieren (CUT, COPY,
PASTE)
------------------------------------------------*/
ADDRESS = 'FinaW'
OPTIONS CACHE RESULTS
STATUS PORTNAME
FW = RESULT
ADDRESS = FW
SIGNAL ON BREAK_C
SIGNAL ON HALT
SIGNAL ON SYNTAX
/*-----------------------------------------------*/
RT.Version = "Version 0.12"
RT.Title = "FWTableEdit"
RT.Para1 = "rt_pubscrname = FinalWriterPubScreen rt_topoffset = 50 rt_reqpos = reqpos_topleftwin"
RT.Copyright = "© 1997-98, by Thorsten Willert"
R = '0A'X
/*-----------------------------------------------*/
IF ~show('L',"rexxreqtools.library") THEN DO
IF ~addlib('rexxreqtools.library',0,-30,0) THEN DO
'ShowMessage 1 1 "Error ..." "Missing rexxreqtools.library!" "" "Exit !!" "" ""'
EXIT 20
END
END
DO FOREVER
OldRes = res
Func = Info("_Copy|_Cut|_Paste|_Exit")
IF GetCursor() = 1 THEN
DO
IF Func = 0 THEN LEAVE
ELSE IF Func = 3 THEN res = OldRes
ELSE res = RowCol()
SELECT
WHEN Func = 1 THEN CALL TABCOPY( res )
WHEN Func = 2 THEN CALL TABCUT( res )
WHEN Func = 3 THEN CALL TABPASTE( res )
OTHERWISE LEAVE
END
END
END
/*-----------------------------------------------*/
Ende:
EXIT
/*-----------------------------------------------*/
GetCursor:
RESULT= ""
ADDRESS(FW)
TableGetActiveCell
PARSE VAR RESULT Zeile Spalte
OldZeile = Zeile
OldSpalte = Spalte
IF Zeile = "" | Spalte = "" THEN /* Geht nicht über GetObjektType */
DO
CALL KeineTabelle
RETURN 0
END
TableGetRows
PARSE VAR RESULT Muell Zeilen
TableGetColumns
PARSE VAR RESULT Muell Spalten
RETURN 1
/*-----------------------------------------------*/
TabCut:
PARSE ARG Func
DROP Zelle.
TableGetColumnWidth Spalte
SpaltenWeite = RESULT
I = 0
IF Func = 1 THEN
DO
TableSetActiveCell Zeile 1
DO I = 1 TO Spalten
TableSetActiveCell Zeile I
CALL GetInhalt
END
TableDeleteRows Zeile 1 FORCE
END
ELSE IF Func = 0 THEN
DO
TableSetActiveCell 1 Spalte
DO I = 1 TO Zeilen
TableSetActiveCell I Spalte
CALL GetInhalt
END
TableDeleteColumns Spalte 1 FORCE
END
REDRAW
Cut = 1
RETURN
/*-----------------------------------------------*/
TabCopy:
PARSE ARG Func
DROP Zelle.
I = 0
TableGetColumnWidth Spalte
SpaltenWeite = RESULT
IF Func = 1 THEN
DO
TableSetActiveCell Zeile 1
DO I = 1 TO Spalten
TableSetActiveCell Zeile I
CALL GetInhalt
END
END
ELSE IF Func = 0 THEN
DO
TableSetActiveCell 1 Spalte
DO I = 1 TO Zeilen
TableSetActiveCell I Spalte
CALL GetInhalt
END
END
Copy = 1
RETURN
/*-----------------------------------------------*/
TabPaste:
PARSE ARG Func
IF Cut = 1 | Copy = 1 THEN
DO
IF SpaltenWeite = "SPALTENWEITE" THEN SpaltenWeite = 2
I = 0
IF Func = 1 THEN
DO
TableInsertRows Zeile+1 1
Redraw
DO I = 1 TO Spalten
TableSetActiveCell Zeile+1 I
CALL SetInhalt
END
END
ELSE IF Func = 0 THEN
DO
TableInsertColumns Spalte+1 1 SpaltenWeite
ReDraw
DO I = 1 TO Zeilen
TableSetActiveCell I Spalte+1
CALL SetInhalt
END
END
END
RETURN
/*-----------------------------------------------*/
GetInhalt:
RESULT = ""
STATUS FontName
Name = RESULT
RESULT = ""
STATUS FontStyle
Style = RESULT
SelectAll
RESULT = ""
STATUS FontSize
Size = RESULT
RESULT = ""
STATUS FontColor
Color = RESULT
RESULT = ""
STATUS Justify
Justi = RESULT
Extract
Inhalt = RESULT
INTERPRET( "Zelle."||I"='"|| Inhalt || "'" )
INTERPRET( "Color."|| I "='" || Color || "'" )
INTERPRET( "Name."|| I "='" || Name || "'" )
INTERPRET( "Size."|| I "='" || Size || "'" )
INTERPRET( "Style."|| I "='" || Style || "'" )
INTERPRET( "Justi."|| I "='" || Justi || "'" )
IF Name.I = "" THEN Name.I = Name.1
IF Size.I = "" THEN Size.I = Size.1
IF Style.I = "" THEN Style.I = Style.1
RETURN
/*-----------------------------------------------*/
SetInhalt:
IF Name.I ~= "" THEN Font Name.I
SelectAll
Style Style.I
FontColor Color.I
FontSize Size.I
Justify Justi.I
IF Zelle.I = "Zelle."||I THEN Zelle.I = ""
Type Zelle.I
RETURN
/*-----------------------------------------------*/
RowCol:
res = rtezrequest("Zeile oder Spalte?","_Zeile|_Spalte",RT.Title)
RETURN res
/*-----------------------------------------------*/
KeineTabelle:
rtezrequest("Zuerst eine Tabelle auswählen" || R ||,
"und Cursor positioniern!","Weiter",RT.Title)
RETURN
/*-----------------------------------------------*/
Info:
PARSE ARG Taste1
res = rtezrequest(RT.Version||","||R||RT.Copyright||R||R||"Tabelle Editieren:",Taste1,RT.Title,RT.Para1)
RETURN res
/*-----------------------------------------------*/
HALT:
BREAK_C:
rtezrequest("Macro wurde abgebrochen ... ","_Weiter",RT.Title)
EXIT 10
/*-----------------------------------------------*/
SYNTAX:
rtezrequest("Fehler!","_Weiter",RT.Title)
EXIT 10